using System.Net.Mime;
using Avalonia.Controls;
using Avalonia.Input;
using AvaloniaApplication1.ViewModels;
using SukiUI.Controls;

namespace AvaloniaApplication1.Views;

public partial class MainWindow : SukiWindow
{
    public MainWindow(MainWindowViewModel mainWindowViewModel)
    {
        InitializeComponent();
        DataContext = mainWindowViewModel;
        //this.PointerPressed+=MainWindow_PointerPressed; //  鼠标按下事件
    }
    /// <summary>
    /// 鼠标按下事件
    /// </summary>
    /// <param name="sender">源</param>
    /// <param name="e">鼠标事件参数</param>
    private void MainWindow_PointerPressed(object? sender, Avalonia.Input.PointerPressedEventArgs e)
    {
        // 判断是否是左键鼠标按下
        if (e.Pointer.Type == PointerType.Mouse&&e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
        {
            this.BeginMoveDrag(e);
        }

    }
}